UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sT3TNTW/Xz/mYwLFod1UvSU3i59VSwZZ/Q8IvHW8kQg='
WHERE
key_id = '85c95c938aae42a23448184c54e878721cce4420eb66d81396c645031e94d68d'
AND (
token = 'sT3TNTW/Xz/mYwLFod1UvSU3i59VSwZZ/Q8IvHW8kQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)