UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wj6aaWxG24JX8DUGi+M2GEE40jzEP1e3QYXZ4Wa09eA='
WHERE
key_id = '3d352eb7f9e61e3c19bb7a81471460e6d603fa3dd5b40e2fe0011e654eae9da9'
AND (
token = 'Wj6aaWxG24JX8DUGi+M2GEE40jzEP1e3QYXZ4Wa09eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)