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