UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h7U+cn6HgpJVMyR9vdJ9M15W5EvZEoHRJ29U9LGmIrM='
WHERE
key_id = '10ed8f65065d7b56eca483175d08985b58cc77fbf7f2d2ef5d098b80f6e0b608'
AND (
token = 'h7U+cn6HgpJVMyR9vdJ9M15W5EvZEoHRJ29U9LGmIrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)