UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BEY/mDiQoooUrz0KTsy8vsxlzb92LLP2p2Vv8G6NBgQ='
WHERE
key_id = '138827940c11de3a284dfaf96d0a472121933753c86a119df85f9f5a95d8e119'
AND (
token = 'BEY/mDiQoooUrz0KTsy8vsxlzb92LLP2p2Vv8G6NBgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)