UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6tH4cUGZKl+KKn8ZDsAKp5iYpqvt1YVQrBW/WpAMpBE=' 
WHERE 
  key_id = 'fc310273933621576a132c9301dec61225a3b885492436be814e073319f42453' 
  AND (
    token = '6tH4cUGZKl+KKn8ZDsAKp5iYpqvt1YVQrBW/WpAMpBE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031