UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NZl5nVze63Fz4U1YouAPG9Ao+by3TTQUbBLEiUdSnjo=' 
WHERE 
  key_id = '94d217b6784b57a371b8167a55164870ff1e10eece52a5bc399e9a7f63f26af3' 
  AND (
    token = 'NZl5nVze63Fz4U1YouAPG9Ao+by3TTQUbBLEiUdSnjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052