UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Erxaz9i/n0yHLCO3Boo3k6IlED0TozihNpwZxasR3XY='
WHERE
key_id = '5079efeaf218f8b111685eb00464a2ba6fa9d787a760b72f2da67ab6329415ec'
AND (
token = 'Erxaz9i/n0yHLCO3Boo3k6IlED0TozihNpwZxasR3XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)