UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f9L3f2dkdR0j1nProA3SewRXGAfqC6rqFiz/NLNbNiA=' 
WHERE 
  key_id = '5938a3e5a9a1584f6798fdf412f3b8350690c3472cd917b780d24a8411660202' 
  AND (
    token = 'f9L3f2dkdR0j1nProA3SewRXGAfqC6rqFiz/NLNbNiA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022