UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xO4nnW9M07TvOmDAu9b+Op7z7DUAIeXTetYk64/iyxI=' 
WHERE 
  key_id = 'b96ba85499ff3e56c72fec35e411b72fb6b3c94fd416b2dc69fb50ca4c308bf1' 
  AND (
    token = 'xO4nnW9M07TvOmDAu9b+Op7z7DUAIeXTetYk64/iyxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039