UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V0p8aNjwV9T7an87lT/VdfTDvlqtwynbWFJhODbxqrE='
WHERE
key_id = 'ab28796644586295644e6bea13404d61da615ac93f5b2aa2cf5d50851b45fd7c'
AND (
token = 'V0p8aNjwV9T7an87lT/VdfTDvlqtwynbWFJhODbxqrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)