UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c3XQNOdhaSF2GtD5feVgDM7qvV5h/9OXGJB/Jtso7EE='
WHERE
key_id = '008caf1a68e8bb410a650014d45d8c8a8dab133f6d778e2ffb137c87ccf03bab'
AND (
token = 'c3XQNOdhaSF2GtD5feVgDM7qvV5h/9OXGJB/Jtso7EE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)