UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCsmsiYMzb4WiAgX4pSiqeiKQn5Y5pLUgcIr+WC9IzQ=' 
WHERE 
  key_id = '5cfdff281e61a564e62e3c9b31af655ece38caf762af4b3c9af1f77fb274af41' 
  AND (
    token = 'GCsmsiYMzb4WiAgX4pSiqeiKQn5Y5pLUgcIr+WC9IzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019