UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kQsw/EPwncYgPG2FOhHClX1AXdFYUnKlLDetgqjynow='
WHERE
key_id = 'fe5e60255d85f291c243d60c68957b3e5f5c2f8dda666e38c9f7b96277d08058'
AND (
token = 'kQsw/EPwncYgPG2FOhHClX1AXdFYUnKlLDetgqjynow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)