UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o+OZFSNxLXDxpQKIk+0pw7Ny/J/dIQWpe183P/q5qTo=' 
WHERE 
  key_id = '90345595c888abff024e9024d0d9ea5a0783a894dcc1035f30de65f73b5d8639' 
  AND (
    token = 'o+OZFSNxLXDxpQKIk+0pw7Ny/J/dIQWpe183P/q5qTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040