UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DwlcdzN1Ss6pa2S1IIDDHfZYgukRuDHDX8nPY1xyNc8='
WHERE
key_id = '836d8292ec410862b80750d42c42ddb40aa5e7308fd098a4be56ec8ef20eb8a0'
AND (
token = 'DwlcdzN1Ss6pa2S1IIDDHfZYgukRuDHDX8nPY1xyNc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)