UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q3Ij8KHbtdwMD6+SykyrlBG8nsmQqdqNIayZlWMyQss='
WHERE
key_id = '1e98c59b278a254fe77108546eb322a1852e548ae5dfcba1173311c64b68ac30'
AND (
token = 'Q3Ij8KHbtdwMD6+SykyrlBG8nsmQqdqNIayZlWMyQss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)