UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N8MWRUYC4TQex0CJORbbCceTHwPRTRbrgq/Zxf3hU78='
WHERE
key_id = 'c7d44a4bf7352d562d958ca0f4ed26f5fe3c225429074a7395ed18804f3c3d32'
AND (
token = 'N8MWRUYC4TQex0CJORbbCceTHwPRTRbrgq/Zxf3hU78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)