UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'akit54k6eNFMyXeYMlMcrIhUm1xocKlyMi4VtGDCT/k='
WHERE
key_id = '1dee064ffa76ab99b70da62e34c7266fdfe3860e444a90cbebffad2d528cbc65'
AND (
token = 'akit54k6eNFMyXeYMlMcrIhUm1xocKlyMi4VtGDCT/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)