UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evjc8QXJsgnuSbTKz4hTevFAcd39DHJObmbs2+0C2bk=' 
WHERE 
  key_id = 'a68613806b10c04605682b0e0dfa08cf6b4b0c69aca24d67857803ad1c69602b' 
  AND (
    token = 'evjc8QXJsgnuSbTKz4hTevFAcd39DHJObmbs2+0C2bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023