UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SlUifKLfGbjGZnfH+gNJEWMpahjVL5c0ld0v2f5+Mnk=' 
WHERE 
  key_id = '8628fe95b93d0650ca2d27f9279ff7ce04f0175a9de2a8738ab9553cbe2bcec3' 
  AND (
    token = 'SlUifKLfGbjGZnfH+gNJEWMpahjVL5c0ld0v2f5+Mnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024