UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wEAE/+YKDLheW5x0MoMma4W6BI+QNIa8JpHJrOGIRbg='
WHERE
key_id = '8397cc857d98101a97c35aa3c0687f8188e4ee95e1568f36e27d1a5d57bf37e8'
AND (
token = 'wEAE/+YKDLheW5x0MoMma4W6BI+QNIa8JpHJrOGIRbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)