UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4o8iNWhgQz4LN/sxT20P/2ic2y6QZy2VsszhFH/LfNg=' 
WHERE 
  key_id = '19e14fe2e3016c5e261ecae4951fa32c34e80a4847b8c7a9242801fb1f921969' 
  AND (
    token = '4o8iNWhgQz4LN/sxT20P/2ic2y6QZy2VsszhFH/LfNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041