UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HU4hKphop5ORlG2436Hlr+2b4I+u6cRsnTSZLBQyJZM='
WHERE
key_id = '33a0f7c72bc3a5fd6d032774d7267f30c8ebf968713f3b1c36084ba68953ec5b'
AND (
token = 'HU4hKphop5ORlG2436Hlr+2b4I+u6cRsnTSZLBQyJZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)