UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l6zzTFoEzf4bn2yyewVBBnyQJJqwYhBCiZGeWVRLaFk=' 
WHERE 
  key_id = 'f875115cd0295011142b2e2e93d5adef8b7d7780ac2dc80b010321bbfc147d63' 
  AND (
    token = 'l6zzTFoEzf4bn2yyewVBBnyQJJqwYhBCiZGeWVRLaFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017