UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aKnrztCG8l5/1Fkj7oIyeHYw+gXqye325KEOhGEjTBQ='
WHERE
key_id = '567ff1d079a5c66e794c4273f67bec978266da53beac01afdedce3b459503b4e'
AND (
token = 'aKnrztCG8l5/1Fkj7oIyeHYw+gXqye325KEOhGEjTBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)