UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mDfyhP7KwybzmQ5sVqQI47I0YEWZGIr9OZC0qogUT1w='
WHERE
key_id = '60bbec2c6d485b5b590f27682afde2cb514b9cb55c6a82ab4aaadf3b1a25cc7e'
AND (
token = 'mDfyhP7KwybzmQ5sVqQI47I0YEWZGIr9OZC0qogUT1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)