UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hw+tRVeK/VAB5i+dk7+qZjcvX2JiaStYyBhfH8iDffw=' 
WHERE 
  key_id = '868468b8a289887ddbb8a0b3101ec37f712bf9c0f1e120cd68f73dc6b3344625' 
  AND (
    token = 'Hw+tRVeK/VAB5i+dk7+qZjcvX2JiaStYyBhfH8iDffw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030