UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQOr4YyaSkF5CbOT70XpxUTr5iTcC51e9QiCLvXMC/8='
WHERE
key_id = '3205de4b1f08df2cd1ea7dd3072597d4ac7380e5f439cc91365036fd6d8b02ac'
AND (
token = 'RQOr4YyaSkF5CbOT70XpxUTr5iTcC51e9QiCLvXMC/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)