UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kqJjxPIrcBKkaqrXwYi20UWtEBiXheWFFN34aqM7hpE='
WHERE
key_id = '35113018bd78e78112dcd159dbbe20870ee3428aae8bd41d5f9ce2b081ca2e02'
AND (
token = 'kqJjxPIrcBKkaqrXwYi20UWtEBiXheWFFN34aqM7hpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)