UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TOEtdp6EntvW5DeppAubiBcI0oOrx2NkXZhE7GpCR+w='
WHERE
key_id = 'fe6619e4376df9a58c98884bb690bad9ae47116433ce6560fa955e56c7b72675'
AND (
token = 'TOEtdp6EntvW5DeppAubiBcI0oOrx2NkXZhE7GpCR+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)