UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOP4pb3MlYmbyoORQlEli0VQ6k1Fd76UtvobD6Fpig4='
WHERE
key_id = '936c722920dc323977e9fe57d09f2d2953fc5352bb735d6d63d9ba0f2be02df2'
AND (
token = 'KOP4pb3MlYmbyoORQlEli0VQ6k1Fd76UtvobD6Fpig4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)