UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LuG3NEfMc20yhhR21uB5jMPgpgaiaWYuS/sRFRuW4Uo='
WHERE
key_id = '282702bc9e03d68f0bcf7ece8e9f12bac80e7c1a80ddb61168798896f27790a4'
AND (
token = 'LuG3NEfMc20yhhR21uB5jMPgpgaiaWYuS/sRFRuW4Uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)