UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hozjKQZ+f2OqBI+4ODX130smXlxPFVPxISXmwpMtqTo='
WHERE
key_id = '3b89de9e0ddeb83b0f1c5512057cb250730732736b5c09667f8bb5b79c16ed4a'
AND (
token = 'hozjKQZ+f2OqBI+4ODX130smXlxPFVPxISXmwpMtqTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)