UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VInaFYIVkW4LzA15jj0mSX4AOuislADH+YfjSjrjx8=' 
WHERE 
  key_id = '64ed91320ee8b1b21ae5647309ad67e6d55acb585324b3922b36259b4d72e9d4' 
  AND (
    token = '/VInaFYIVkW4LzA15jj0mSX4AOuislADH+YfjSjrjx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028