UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LCDkGVwmdu27uDwD+BcUksii0RzF9wl9dihxHkbIRaw='
WHERE
key_id = '4009910839ed78ae6215d14a814d6402c119d1d3415c805bbdbe6adef1c1e377'
AND (
token = 'LCDkGVwmdu27uDwD+BcUksii0RzF9wl9dihxHkbIRaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)