UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oxs3DNEF1MQg1LAopC4KQUhZ+aiKBUJtc26EK+eNfzQ=' 
WHERE 
  key_id = 'bf82a13d1943c26af3c5a7e2f41ff4100510756e843e6cc78ceded0144b7dfa2' 
  AND (
    token = 'Oxs3DNEF1MQg1LAopC4KQUhZ+aiKBUJtc26EK+eNfzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033