UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ihta0IA38lIPAX05f60Zj/WHq6vxFZEBfD9Co6nvNIg='
WHERE
key_id = '7e3c617be18f812ad60783f485d7df4b77bc9dcd2906711535c434d0e9570f09'
AND (
token = 'Ihta0IA38lIPAX05f60Zj/WHq6vxFZEBfD9Co6nvNIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)