UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '55vg1/LZUM/aYqsxNPoskwFwCIKcaV2RBoTd/ayUFqQ=' 
WHERE 
  key_id = '1186bed9d899eaef66ae982912f2a21b5f2dc0a9812d1d8d3f38365e71d6441e' 
  AND (
    token = '55vg1/LZUM/aYqsxNPoskwFwCIKcaV2RBoTd/ayUFqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025