UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '52hp/MVLXKNULPUNfGUs/hYn1tuw1pZpVNDJ0KD71Rw='
WHERE
key_id = '3da9211c71fae058cab93106e6fd7e628701955635675731c161b534b0cf6461'
AND (
token = '52hp/MVLXKNULPUNfGUs/hYn1tuw1pZpVNDJ0KD71Rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)