UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZ8AFMLGmAi5NYQp/WA/tMWssLN6XD0hwwImsd/IFuQ='
WHERE
key_id = '3f0435927cf72baab4f4ede2b8bb35515e1941566812ad6397dd8fd8dbbe642f'
AND (
token = 'hZ8AFMLGmAi5NYQp/WA/tMWssLN6XD0hwwImsd/IFuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)